var deviceone = require("deviceone");
var nf = deviceone.sm("do_Notification");
var http = require("helper/http");
var userUrl = require("url/user");
var userHelper = require("helper/user");
/**
 * trueBack 成功函数 falseBack 失败函数
 */
module.exports.isCommunityAuth = function(trueBack,falseBack) {
	if(null==userHelper.loginToken()||''==userHelper.loginToken()){
		nf.toast("请先登录。")
		return;
	}
	http.post(userUrl.url.login.isCommunityAuth, {}, function(data) {
		if(data.isCommunityAuth){
			if(trueBack && trueBack!=null && trueBack!=="undefined"){
				trueBack();
			}	
		}else{
			if(falseBack && falseBack!=null && falseBack!=="undefined"){
				falseBack()
			}
		}
	});
};
